// pages/navigation/old/jw/detail/detail.js
Page({
  data:{
   content:{}
  },
onLoad(optional){
  let that=this
   console.log('进入详情页面啦',optional)
   wx.cloud.database().collection('jw_info')
   .doc(optional.id)
   .get()
   .then(res=>{
     var list=res.data
     list.date=this.getDateAndTime(list.date)
     that.setData({
       content:list
     })
   })
   .catch(res=>{
     console.log('获取内容失败',res);
   })

},
getDateAndTime:function(date) {
  var Y= date.getFullYear();
  var M = date.getMonth() + 1;
  M = M < 10 ? '0' + M : M;
  var D = date.getDate();
  D = D < 10 ? '0' + D : D;
  var hour = date.getHours();
  hour = hour < 10? '0' + hour : hour;
  var minute = date.getMinutes();
  minute = minute < 10? '0' + minute : minute;
  return Y + '年' + M + '月' + D + '日' + ' ' + hour + ':' + minute; 
}
})